package leetcode.leetcode242;

import java.util.Arrays;

/**
 * @author czt
 * @version 1.0
 * @since 2025/1/7
 *
 * 判断两个单词是否为字母异位词
 */
public class Leetcode242 {

    public boolean isAnagram(String s, String t) {
        char[] sCharArray = s.toCharArray();
        Arrays.sort(sCharArray);
        String sKey = new String(sCharArray);

        char[] tCharArray = t.toCharArray();
        Arrays.sort(tCharArray);
        String tKey = new String(tCharArray);
        return sKey.equals(tKey);
    }
}
